var div = $("div");
div.addClass("test");
var pass = true;
for ( var i = 0; i &lt; div.size(); i++ ) {
 if ( div.get(i).className.indexOf("test") == -1 ) pass = false;
}
ok( pass, "Add Class" );